package gbench.tartarus.hipponoe.appitf;


import gbench.common.tree.LittleTree.IRecord;
import gbench.tartarus.hipponoe.finance.acct.AccountingApp;
import gbench.tartarus.hipponoe.mvc.annotation.IRecordParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static gbench.common.tree.LittleTree.IRecord.REC;

@RestController
@RequestMapping("/acct")
public class FinanceAccounting {

    /**
     *  余额平衡宝
     * @param rec 请求参数
     * @return 试算平衡表
     */
    @RequestMapping("balance")
    public IRecord balance(@IRecordParam IRecord rec) {
        final var balance = AccountingApp.getAcctBalance();
        return REC(balance.asJavaMap());
    }

}
